package com.sanjiahantang.youjiaclient.module.evaluate.beans;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.sanjiahantang.youjiaclient.base.BaseBean;
import com.sanjiahantang.youjiaclient.module.goods.beans.GoodsBean;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by zy on 2017/9/6.
 * 服务评价
 */

public class EvaServiceBean extends BaseBean {
    public Data getData() {
        return new Gson().fromJson(data,Data.class);
    }

    public void setData(String data) {
        this.data = data;
    }

    private String data;

    public static class Data extends ListBean{
        private List<Item> list;

        public List<Item> getList() {
            return list;
        }

        public void setList(List<Item> list) {
            this.list = list;
        }
    }

    public static class Item{
        /*
        * {
        \"userRequireId\": 9,
        \"msId\": 2,
        \"roleTypeId\": 1,
        \"roleTypeName\": \"项目经理\",
        \"phone\": \"18822185396\",
        \"createTime\": \"2017-09-27T13: 01: 18.000+0000\",
        \"rolePhone\": \"15620560524\",
        \"roleName\": \"张三\",
        \"place\": \"这个项目经理很不错，推荐给大家\",
        \"userNumber\": 5
    }
]
        * */
        private String place;//评价内容
        private String name;//业务人员昵称
        private String roleTypeName;//业务人员角色
        private int userNumber;//评分
        private String phone;
        private String rolePhone;
        private int userRequireId;
        private int msId;
        private int roleTypeId;
        private String createTime;
        private String roleName;
        private String userUrl;
        private String appraiseUrl;
        private List<GoodsBean.Image> imgList;

        public List<GoodsBean.Image> getImgList() {
            return imgList;
        }

        public void setImgList(List<GoodsBean.Image> imgList) {
            this.imgList = imgList;
        }

        public String getAppraiseUrl() {
            return appraiseUrl;
        }

        public void setAppraiseUrl(String appraiseUrl) {
            this.appraiseUrl = appraiseUrl;
        }

        public String getRoleName() {
            return roleName;
        }

        public void setRoleName(String roleName) {
            this.roleName = roleName;
        }

        public String getUserUrl() {
            return userUrl;
        }

        public void setUserUrl(String userUrl) {
            this.userUrl = userUrl;
        }

        private String headPhoto;//业务人员头像


        public String getCreateTime() {
            return createTime;
        }

        public void setCreateTime(String createTime) {
            this.createTime = createTime;
        }

        public String getPhone() {
            return phone;
        }

        public void setPhone(String phone) {
            this.phone = phone;
        }

        public String getRolePhone() {
            return rolePhone;
        }

        public void setRolePhone(String rolePhone) {
            this.rolePhone = rolePhone;
        }

        public int getUserRequireId() {
            return userRequireId;
        }

        public void setUserRequireId(int userRequireId) {
            this.userRequireId = userRequireId;
        }

        public int getMsId() {
            return msId;
        }

        public void setMsId(int msId) {
            this.msId = msId;
        }

        public int getRoleTypeId() {
            return roleTypeId;
        }

        public void setRoleTypeId(int roleTypeId) {
            this.roleTypeId = roleTypeId;
        }



        public String getHeadPhoto() {
            return headPhoto;
        }

        public void setHeadPhoto(String headPhoto) {
            this.headPhoto = headPhoto;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getRoleTypeName() {
            return roleTypeName;
        }

        public void setRoleTypeName(String roleTypeName) {
            this.roleTypeName = roleTypeName;
        }



        public String getPlace() {
            return place;
        }

        public void setPlace(String place) {
            this.place = place;
        }

        public int getUserNumber() {
            return userNumber;
        }

        public void setUserNumber(int userNumber) {
            this.userNumber = userNumber;
        }

        public List<Image> getImages(){
            List<Image> imgList = new ArrayList<>();
            if (appraiseUrl != null){
                String[] arr = appraiseUrl.split(",");
                for (int i = 0;i<arr.length;i++){
                    Image img = new Image();
                    img.setUrl(arr[i]);
                    imgList.add(img);
                }
            }
            return imgList;
        }


    }

}
